package com.gaohe.post.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.post.mapper.FmPostContactMapper;
import com.gaohe.post.domain.FmPostContact;
import com.gaohe.post.service.IFmPostContactService;

/**
 * 帖子联系Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmPostContactServiceImpl implements IFmPostContactService 
{
    @Autowired
    private FmPostContactMapper fmPostContactMapper;

    /**
     * 查询帖子联系
     * 
     * @param postContactId 帖子联系主键
     * @return 帖子联系
     */
    @Override
    public FmPostContact selectFmPostContactByPostContactId(Long postContactId)
    {
        return fmPostContactMapper.selectFmPostContactByPostContactId(postContactId);
    }

    /**
     * 查询帖子联系列表
     * 
     * @param fmPostContact 帖子联系
     * @return 帖子联系
     */
    @Override
    public List<FmPostContact> selectFmPostContactList(FmPostContact fmPostContact)
    {
        return fmPostContactMapper.selectFmPostContactList(fmPostContact);
    }

    /**
     * 新增帖子联系
     * 
     * @param fmPostContact 帖子联系
     * @return 结果
     */
    @Override
    public int insertFmPostContact(FmPostContact fmPostContact)
    {
        fmPostContact.setCreateTime(DateUtils.getNowDate());
        return fmPostContactMapper.insertFmPostContact(fmPostContact);
    }

    /**
     * 修改帖子联系
     * 
     * @param fmPostContact 帖子联系
     * @return 结果
     */
    @Override
    public int updateFmPostContact(FmPostContact fmPostContact)
    {
        fmPostContact.setUpdateTime(DateUtils.getNowDate());
        return fmPostContactMapper.updateFmPostContact(fmPostContact);
    }

    /**
     * 批量删除帖子联系
     * 
     * @param postContactIds 需要删除的帖子联系主键
     * @return 结果
     */
    @Override
    public int deleteFmPostContactByPostContactIds(Long[] postContactIds)
    {
        return fmPostContactMapper.deleteFmPostContactByPostContactIds(postContactIds);
    }

    /**
     * 删除帖子联系信息
     * 
     * @param postContactId 帖子联系主键
     * @return 结果
     */
    @Override
    public int deleteFmPostContactByPostContactId(Long postContactId)
    {
        return fmPostContactMapper.deleteFmPostContactByPostContactId(postContactId);
    }
}
